package com.cc.config;

import com.cc.utils.PasswordUtils;
import lombok.Getter;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;

/**
 * @author shadow
 */
@Getter
@Configuration
@ConfigurationProperties("password")
public class PasswordConfig {
    /**
     * 密钥
     */
    private String key;

    public void setKey(String key) {
        this.key = key;
        // 初始化工具类中的静态字段
        PasswordUtils.initKey(key);
    }
}